package cn.com.fssg.platform.base.handler.impl;

import cn.com.fssg.platform.base.handler.InterfaceHandler;
import cn.com.fssg.platform.modules.engine.util.MinioUtil;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author : xzt
 * @description :
 * @createDate : 2025/9/1 20:01
 */
public class MinioDownloadDemoExtend implements InterfaceHandler {
    private MinioUtil minioUtil = MinioUtil.cur();
    @Override
    public Object run(HttpServletRequest request, JSONObject jsonObject) throws Exception {
        return null;
    }

    @Override
    public void run(HttpServletRequest request, HttpServletResponse response, JSONObject jsonObject) throws Exception {
        String fileName = (String) jsonObject.get("fileId");
        System.out.println(fileName);
        minioUtil.download(response,fileName,null);
        response.flushBuffer();
    }
}

